package com.example.a33mvvm.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.a33mvvm.R;
import com.example.a33mvvm.utils.ImageLoader;
import com.example.base_mvvm.base.view.GiftEntity;

import java.util.List;

public class GiftAdapter extends BaseQuickAdapter<GiftEntity.DataBean, BaseViewHolder> {
    public GiftAdapter(@Nullable List<GiftEntity.DataBean> data) {
        super(R.layout.gift_item, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, GiftEntity.DataBean dataBean) {
        ImageView view = baseViewHolder.getView(R.id.item_gift_icon_iv);
        ImageLoader.getInstance().LoadImage(getContext(),dataBean.getGiftpath(),view);
        baseViewHolder.setText(R.id.item_gift_price_tv,dataBean.getPrice()+"抖币");
    }
}
